package com.ygqh.baby.po;

import com.ygqh.baby.ao.CardMode;
import com.ygqh.baby.ao.CardType;
import com.ygqh.baby.ao.DataStatus;
import com.ygqh.baby.utils.DateConvertUtils;

import java.math.BigDecimal;
import java.util.Date;

public class YgCardCoupon implements Cloneable {
    private Long id;

    private String title;

    private CardType cardType;

    private CardMode cardMode;

    private String productIds;

    private BigDecimal balancePrice;

    private Long couponId;

    private Date startDate;

    private Date endDate;

    private String createBy;

    private Date createTime;

    private String updateBy;

    private Date updateTime;

    private DataStatus status;

    private String remark;

    // 运营系统使用
    private String productCode;

    //----


    private String productName;
    private String imagePath;
    private BigDecimal faceValue;
    private BigDecimal salePrice;
    private String color;

    //=================================
    /**
     * 指定兑换的sku
     * <p>
     * 目前砍价会用到
     */
    private Long skuId;
    /**
     * 卡券有效期 单位小时
     */
    private int cardCountDown;

    //=================================
    public int getCardCountDown() {
        return cardCountDown;
    }

    public void setCardCountDown(int cardCountDown) {
        this.cardCountDown = cardCountDown;
    }

    public Long getSkuId() {
        return skuId;
    }

    public void setSkuId(Long skuId) {
        this.skuId = skuId;
    }

    public String getProductName() {
        return productName;
    }

    public void setProductName(String productName) {
        this.productName = productName;
    }

    public String getImagePath() {
        return imagePath;
    }

    public void setImagePath(String imagePath) {
        this.imagePath = imagePath;
    }

    public BigDecimal getFaceValue() {
        return faceValue;
    }

    public void setFaceValue(BigDecimal faceValue) {
        this.faceValue = faceValue;
    }

    public BigDecimal getSalePrice() {
        return salePrice;
    }

    public void setSalePrice(BigDecimal salePrice) {
        this.salePrice = salePrice;
    }

    public String getColor() {
        return color;
    }

    public void setColor(String color) {
        this.color = color;
    }

    public String getProductCode() {
        return productCode;
    }

    public void setProductCode(String productCode) {
        this.productCode = productCode;
    }

    public String getMonth() {
        if (startDate == null) {
            return "";

        }
        return DateConvertUtils.format(startDate, "yyyy-MM");
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title == null ? null : title.trim();
    }

    public CardType getCardType() {
        return cardType;
    }

    public void setCardType(CardType cardType) {
        this.cardType = cardType;
    }

    public CardMode getCardMode() {
        return cardMode;
    }

    public void setCardMode(CardMode cardMode) {
        this.cardMode = cardMode;
    }

    public String getProductIds() {
        return productIds;
    }

    public void setProductIds(String productIds) {
        this.productIds = productIds;
    }

    public BigDecimal getBalancePrice() {
        return balancePrice;
    }

    public void setBalancePrice(BigDecimal balancePrice) {
        this.balancePrice = balancePrice;
    }

    public Long getCouponId() {
        return couponId;
    }

    public void setCouponId(Long couponId) {
        this.couponId = couponId;
    }

    public Date getStartDate() {
        return startDate;
    }

    public void setStartDate(Date startDate) {
        this.startDate = startDate;
    }

    public Date getEndDate() {
        return endDate;
    }

    public void setEndDate(Date endDate) {
        this.endDate = endDate;
    }

    public String getCreateBy() {
        return createBy;
    }

    public void setCreateBy(String createBy) {
        this.createBy = createBy == null ? null : createBy.trim();
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public String getUpdateBy() {
        return updateBy;
    }

    public void setUpdateBy(String updateBy) {
        this.updateBy = updateBy == null ? null : updateBy.trim();
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public DataStatus getStatus() {
        return status;
    }

    public void setStatus(DataStatus status) {
        this.status = status;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark == null ? null : remark.trim();
    }

    @Override
    public YgCardCoupon clone() {
        YgCardCoupon card = null;
        try {
            card = (YgCardCoupon) super.clone(); // 浅复制
        } catch (CloneNotSupportedException e) {
            e.printStackTrace();
        }
        return card;
    }

    @Override
    public String toString() {
        return "YgCardCoupon [id=" + id + ", title=" + title + ", cardType=" + cardType + ", cardMode=" + cardMode
                + ", productIds=" + productIds + ", balancePrice=" + balancePrice + ", couponId=" + couponId
                + ", startDate=" + startDate + ", endDate=" + endDate + ", createBy=" + createBy + ", createTime="
                + createTime + ", updateBy=" + updateBy + ", updateTime=" + updateTime + ", status=" + status
                + ", remark=" + remark + "]";
    }

}